//
//  SWMusicCategoryFetchReq.swift
//  ChildStory
//
//  Created by linhan on 2016/12/23.
//  Copyright © 2016年 Aiya. All rights reserved.
//

import Foundation

class SWMusicCategoryFetchReq: SWBaseRequest
{
    override init()
    {
        super.init()
        api = SWRequestAPI.MusicCategoryFetch
    }
    
    override func JSONToModel(_ json:JSON, JSONString:String, JSONData:Data) -> AnyObject?
    {
        return Mapper<SWMusicCategoryFetchRsp>().map(JSONString: JSONString)
    }
}

class SWMusicCategoryFetchRsp: NSObject,Mappable
{
    var categories:[SWMusicCategoryRsp]?
    var code:String?
    required init?(map: Map) { }
    
    // Mappable
    func mapping(map: Map) {
        code        <- map["Statu"]
        categories  <- map["BaseModle"]
    }
}

class SWMusicCategoryRsp: NSObject,Mappable
{
    var name:String?
    var desc:String?
    var categoryID:Int?
    //var sort:Int?
    
    required init?(map: Map) { }
    
    // Mappable
    func mapping(map: Map) {
        name        <- map["name"]
        desc        <- map["des"]
        categoryID  <- map["musictypeid"]
        //sort        <- map["sort"]
    }
}
